<?php


namespace app\common\model;


use think\Model;

class JlLqLog extends Model
{
    protected $pk = "id";
    // 定义时间戳字段名
    protected $createTime = 'add_time';
    //修改format类型
    protected $dateFormat = "Y-m-d H:i:s";
    protected $type = [
        'money'      => 'float',
    ];
    public function getPkAttr($value,$data) {
        return $this->pk;
    }
    public function user(){
        return $this->hasOne(Users::class, 'user_id','user_id');
    }
    public function getTypeTextAttr($value,$data) {
        $status = [1=>'团队分红',2=>'加权分红'];
        return $status[$data['type']];
    }
}
